package com.jtpay.ysfproductionprocess.utils;

/**
 * Created by Joe on 2017/09/04 14:56.
 * global constants
 */

public class PayContext {
    static final String TAG = "jun_up";
    public static final boolean Debug = true;
    static final String LOG_DIR_NAME = "log";
    static final String IMG_DIR_NAME = "img";
    public static boolean isAppFinish = false;
    public static boolean timeRunning = false;
    public static boolean needSendBroadcast = false;//service need

    public static final int QR_PRODUCT_DELAY_TIME_DEF = 600;
    public static final int QR_PRODUCT_GET_HEADER_DELAY_TIME = 50000;
    public static final int NEED_QR_PRODUCT_COUNT_DEF = 5;
    public static int NEED_QR_PRODUCT_COUNT = NEED_QR_PRODUCT_COUNT_DEF;//header need product count
    public static final int API_ERROR_COUNT_DEF = 5;
    public static int API_ERROR_COUNT = API_ERROR_COUNT_DEF;//
    public static final int LOG_CLEAN_LINE = 200;//when match the value  clean log content
    public static final String SP_SHOP_CODE_KEY = "ShopCode";//when match the value  clean log content
    public static final String SP_SHOP_YSF_ACCOUNT_KEY = "ShopYsfAccount";//when match the value  clean log content
    public static final String SP_API_BASE_IP_KEY = "BaseUrlIP";//when match the value  clean log content
    public static final String SP_SHOP_SYSTEMCODE_KEY = "systemCode";
    public static final String BROADCAST_CONTENT_KEY = "CONTENT";
    public static final String BROADCAST_ACCOUNT_KEY = "ACCOUNT_KEY";
    //支付方式 14 ysf  4 ali, 3 wx
    public static final String PAYMENT = "14";

    /*
    *  0 default  1 start   2 has result
    */
    public static int CheckAccountStatus = 0;

    private static final int LOG_DELETE_DAYS_DEF = 5;
    static int LOG_DELETE_DAYS = LOG_DELETE_DAYS_DEF;
    /*
        static param with default value
    */
//    public static final int OFFICE_NUM = 10; // upload data list size
    public static final int OFFICE_LIMIT_NUM = 1; // upload data limit size

    public static final String ACTION_UNION_PAY_CHECK_ACCOUNT = "intent.action.up.check_account";
    public static final String ACTION_UNION_PAY_GET_HEADER = "intent.action.up.header";
    public static final String ACTION_UNION_PAY_GET_HEADER_RESULT = "intent.action.header.result";
    public static final String ACTION_CONTINUE_TASK = "intent.action.continue_task";
    public static final String ACTION_UNION_PAY_SHOW_LOG = "intent.action.UNION_PAY_SHOW_LOG";
    public static final String ACTION_UNION_PAY_SHOW_TOAST = "intent.action.UNION_PAY_SHOW_TOAST";

    public static void resetProductCount() {
        NEED_QR_PRODUCT_COUNT = NEED_QR_PRODUCT_COUNT_DEF;
    }

    public static void resetErrorCount() {
        API_ERROR_COUNT = API_ERROR_COUNT_DEF;
    }

}
